3.2456 \(\int \frac {a+b x^n}{x^2} \, dx\)

Optimal. Leaf size=22 \[ -\frac {a}{x}-\frac {b x^{n-1}}{1-n} \]

[Out]

-a/x-b*x^(-1+n)/(1-n)

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {14} \[ -\frac {a}{x}-\frac {b x^{n-1}}{1-n} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*x^n)/x^2,x]

[Out]

-(a/x) - (b*x^(-1 + n))/(1 - n)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin {align*} \int \frac {a+b x^n}{x^2} \, dx &=\int \left (\frac {a}{x^2}+b x^{-2+n}\right ) \, dx\\ &=-\frac {a}{x}-\frac {b x^{-1+n}}{1-n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 22, normalized size = 1.00 \[ -\frac {a}{x}-\frac {b x^{n-1}}{1-n} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^n)/x^2,x]

[Out]

-(a/x) - (b*x^(-1 + n))/(1 - n)

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 23, normalized size = 1.05 \[ -\frac {a n - b x^{n} - a}{{\left (n - 1\right )} x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)/x^2,x, algorithm="fricas")

[Out]

-(a*n - b*x^n - a)/((n - 1)*x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {b x^{n} + a}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)/x^2,x, algorithm="giac")

[Out]

integrate((b*x^n + a)/x^2, x)

________________________________________________________________________________________

maple [A]  time = 0.01, size = 21, normalized size = 0.95 \[ \frac {\frac {b \,{\mathrm e}^{n \ln \relax (x )}}{n -1}-a}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*x^n)/x^2,x)

[Out]

(b/(-1+n)*exp(n*ln(x))-a)/x

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x^n)/x^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(n-2>0)', see `assume?` for mor
e details)Is n-2 equal to -1?

________________________________________________________________________________________

mupad [B]  time = 1.19, size = 20, normalized size = 0.91 \[ \frac {b\,x^n}{x\,\left (n-1\right )}-\frac {a}{x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x^n)/x^2,x)

[Out]

(b*x^n)/(x*(n - 1)) - a/x

________________________________________________________________________________________

sympy [A]  time = 0.43, size = 32, normalized size = 1.45 \[ \begin {cases} - \frac {a n}{n x - x} + \frac {a}{n x - x} + \frac {b x^{n}}{n x - x} & \text {for}\: n \neq 1 \\- \frac {a}{x} + b \log {\relax (x )} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*x**n)/x**2,x)

[Out]

Piecewise((-a*n/(n*x - x) + a/(n*x - x) + b*x**n/(n*x - x), Ne(n, 1)), (-a/x + b*log(x), True))

________________________________________________________________________________________